/**
 * @Author: Yosoo
 * @Date: 2025/5/16 15:17
 * @Description:
 */
package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.annotation.AutoFill;
import com.sky.entity.Category;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
public interface CategoryMapper{
    Page<Category> pageQuery(Category build);

    @AutoFill(OperationType.UPDATE)
    void update(Category category);

    @AutoFill(OperationType.INSERT)
    void insert(Category category);

    @Select("select * from category where type = #{type}")
    List<Category> list(Integer type);

    @Delete("delete from category where id = #{id}")
    void delete(Long id);
}
